{extend name="public/father" /}


{block name='main'}

<div class="layui-card">
	<div class="layui-card-body">

		<form class="layui-form" method="post">

			<div class="layui-form-item">
				<label class="layui-form-label">配置分组</label>
				<div class="layui-input-block">
					<select name="group" lay-verify="required">

						{foreach $system_config as $k=>$v}
						<option value="{$k}" {$data.group==$k ? 'selected' : ''}>{$v} [{$k}]</option>
						{/foreach}

					</select>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">排序</label>
				<div class="layui-input-block">
					<input type="text" name="sort" value="{$data.sort}" required lay-verify="number" autocomplete="off" class="layui-input">
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">配置标题</label>
				<div class="layui-input-block">
					<input type="text" name="title" value="{$data.title}" required lay-verify="required" autocomplete="off" class="layui-input">
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">配置名称</label>
				<div class="layui-input-block">
					<input type="text" name="name" value="{$data.name}" required lay-verify="required" placeholder="由英文字母和下划线组成" autocomplete="off" class="layui-input">
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">配置类型</label>
				<div class="layui-input-block">
					<select name="type" lay-verify="required">
						<option value="input" {$data.type=='input' ? ' selected': ''}>单行文本 [input]</option>
						<option value="textarea" {$data.type=='textarea' ? ' selected': ''}>多行文本 [textarea]</option>
<!--						<option value="switch" {$data.type=='switch' ? ' selected': ''}>[switch]开关</option>-->
<!--						<option value="radio" {$data.type=='radio' ? ' selected': ''}>[radio]单选按钮</option>-->
<!--						<option value="checkbox" {$data.type=='checkbox' ? ' selected': ''}>[checkbox]多选框</option>-->
						<option value="select" {$data.type=='select' ? ' selected': ''}>下拉框 [select]</option>
						<option value="image" {$data.type=='image' ? ' selected': ''}>图片 [image]</option>
<!--						<option value="file" {$data.type=='file' ? ' selected': ''}>[file]文件</option>-->

						<!--<option value="tags" {$data.type=='tags' ? ' selected': ''}>[tags]标签</option>-->
						<!--<option value="hidden" {$data.type=='hidden' ? ' selected': ''}>[hidden]隐藏</option>-->
						<option value="array" {$data.type=='array' ? ' selected': ''}>数组 [array]</option>

						<!--<option value="datetime" {$data.type=='datetime' ? ' selected': ''}>[datetime]日期+时间</option>-->
						<!--<option value="date" {$data.type=='date' ? ' selected': ''}>[date]日期</option>-->
						<!--<option value="time" {$data.type=='time' ? ' selected': ''}>[time]时间</option>-->
					</select>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">配置默认值</label>
				<div class="layui-input-block">
					<textarea name="value" placeholder="配置类型为数组时请按如下格式填写：
值|值|值" class="layui-textarea">{$data.value}</textarea>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">配置选项</label>
				<div class="layui-input-block">
					<textarea name="options" placeholder="仅适用类型：单选按钮、多选框、下拉框、开关，格式：
选项值:选项名
选项值:选项名
1:北京
2:上海" class="layui-textarea">{$data.options}</textarea>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">配置提示</label>
				<div class="layui-input-block">
					<textarea name="tips" placeholder="[选填，支持HTML]" class="layui-textarea">{$data.tips}</textarea>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">状态</label>
				<div class="layui-input-block">
					<input type="checkbox" name="status" value="1" lay-skin="switch" lay-text="启用|禁用" {$data.status==1? ' checked': ''}>
				</div>
			</div>

			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit lay-filter="edit">立即提交</button>
				</div>
			</div>
		</form>

	</div>
</div>

<script>
	var editId = "{$data.id|default=0}";
</script>
{/block}
